from selenium import webdriver
from time import sleep
import pytest
from selenium.webdriver.common.by import By

driver=webdriver.Chrome()
driver.get('https://www.baidu.com/')
driver.find_element(By.LINK_TEXT,'新闻').click()
sleep(2)
driver.switch_to.window(driver.window_handles[-1])
sleep(5)
driver.quit()
if __name__ == '__main__':
    pytest.main(['./baidu.py','-s','--clean-alluredir','--alluredir=./report'])
    os.system('allure generate ./report -o ./html --clean')